package com.aps.util;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

import com.aps.service.ScheduleThread;

/**
 * @author liaoguangan
 * @description <项目启动后执行>
 * @date 2018/4/1 18:23
 */
@Component
public class ApsCommandRunner implements CommandLineRunner {

    @Autowired
    private ScheduleComponent scheduleComponent;

    @Autowired
    private ScheduleThread scheduleThread;

    @Override
    public void run(String... args) throws Exception {

        //初始化排程全局配置
        scheduleComponent.loadConfig();

        //启动排程监听
        scheduleThread.start();
    }
}
